package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestRgt;
import com.estar.assistsurvy.entity.ResponseRgt;
import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class RegisterThread extends BaseThread {

	private RequestRgt requestRgt;

	public RegisterThread(Context context, Handler handler, RequestRgt requestRgt) {
		super(context, handler);
		this.requestRgt = requestRgt;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.REGISTER_SERVICE;
		json=gson.toJson(requestRgt);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "注册用户返回值"+result);
			ResponseRgt register=new ResponseRgt();
			register=gson.fromJson(result, ResponseRgt.class);
			
			msg.what=1;
			msg.obj=register;
			msg.sendToTarget();
		}
	}
}
